<!DOCTYPE html>

<html lang="${lang}">
    <head>
        <title>#{get 'title' /}</title>
        <meta charset="${_response_encoding}" />
        <link rel="stylesheet" media="screen" href="@{'/public/stylesheets/crud.css'}" />
        <link rel="stylesheet" type="text/css" media="screen" href="@{'/public/stylesheets/main.css'}" />
        <link rel="stylesheet" type="text/css" media="screen" href="@{'/public/stylesheets/admin.css'}" />
        <link rel="stylesheet" type="text/css" media="screen" href="@{'/public/stylesheets/secure.css'}" />
        <link rel="stylesheet" type="text/css" media="screen" href="@{'/public/jquery/jquery-ui-1.8.20.custom.css'}">
		<script type="text/javascript" src="@{'/public/jquery/jquery-1.7.2.min.js'}"></script>
		<script type="text/javascript" src="/public/jquery/jquery-ui-1.8.20.custom.min.js"></script>
		<script type="text/javascript" src="/public/jquery/jquery.ui.datepicker-uk.js"></script>
		<script type="text/javascript" src="/public/jquery/jquery.ui.datepicker-ru.js"></script>
		<script type="text/javascript" src="/public/scripts/admin.js"></script>
    </head>
    <script type="text/javascript">
    $(document).ready(function() {
    	var headerImgHeight = 80;
    	var footerHeight = 35;
    	var paddings = 40;
    	var windowHeight = $(window).height() - headerImgHeight - footerHeight - paddings;
    	var contentHeight = $("#crudContent").height();
    	if(contentHeight < windowHeight) {
    		$('#crudContent').height(windowHeight);
    	}
    });
    </script>
    <body id="crud">
		#{header /}

        <div id="navigation">
        	<div id="breadcrumb">
            	#{navigation /}
        	</div>
        	<div id="logout">
            	<a class="logoutLink" href="@{Secure.logout()}">&{'logout'}</a>
        	</div>
        	<div id="loggedUser">
        		<span>[${session.user}]</span>
        	</div>
        </div>

			#{if flash.success}
            <div class="crudFlash flashSuccess">
                ${flash.success}
            </div>
			#{/if}
			#{if flash.error || error}
            <div class="crudFlash flashError">
                ${error ?: flash.error}
            </div>
			#{/if}

        <div id="crudContent">
			#{doLayout /}
        </div>

        #{footer /}

    </body>
</html>
